package cn.edu.scau.cmi.wuyihan.composite.consistent;

import java.util.List;

public class Person extends Organization {

	public Person() {}
	
	public Person(String name) {
		this.name = name;
	}
	
	@Override
	public String getName() {
		return this.name;
	}

	@Override
	public String toString() {
		return "（个人，"+this.name+"）";
	}
	
	@Override
	public void addChildren(Organization organization) {
		System.out.println("对不起，该对象是叶子节点，增加孩子节点失败！");
	}
	
	@Override
	public void deleteChildren(Organization organization) {
		System.out.println("对不起，该对象是叶子节点，删除孩子节点失败！");
	}

	@Override
	public List<Organization> getChildren(){
		System.out.println("对不起，该对象是叶子节点，没有孩子节点！");
		return null;
	}

	@Override
	public void setChildren(List<Organization> children) {
		System.out.println("对不起，该对象是叶子节点，无法设置孩子节点集合！");
	}
}
